<!DOCTYPE html>
<html>
<head>
    <title>Global Object Window Example</title>
    <script type="text/javascript">
    
        var color = "red";
        
        function sayColor(){
            alert(window.color);
        }
        
        window.sayColor();  //"red"
        
    </script>
</head>
<body>

</body>
</html>